home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!news
- From: Rajendra_Singh@msn.com (Rajendra Singh)
- Newsgroups: comp.lang.c
- Subject: Re: Checking for a file => Does it exist (Help)
- Date: Thu, 18 Jan 1996 03:52:32 GMT
- Organization: HookUp Communication Corporation, Oakville, Ontario, CANADA
- Message-ID: <4dk545$dts@noc.tor.hookup.net>
- References: <4d9k6fINNnja@faatcrl.faa.gov> <4df2ej$pqr@news.infi.net>
- NNTP-Posting-Host: u36u400.tor.hookup.net
- NNTP-Posting-User: u36u400
- X-Newsreader: Forte Free Agent 1.0.82
-
- nngis@norfolk.infi.net (Greg DiGiorgio) wrote:
-
- >In article <4d9k6fINNnja@faatcrl.faa.gov>, afrawert@faatcrl.faa.gov
- >says...
- >>
- >>
- >>
- >> I'm having a problem just checking to see if a
- >file
- >>exists. Does anyone have a simple piece of code that I can use?
-
- The "access()" function returns 0 if a file exists. The following
- line would satisfy your need:
-
- if (!access(fileName, F_OK))
- puts("File exists!");
-
-
- ---
- Rajendra Singh, B. Sc. (Rajendra_Singh@msn.com)
- "What is understood need not be discussed." - Loren Adams
-
-